The present invention relates generally to methods and systems for blending computer generated graphics objects and more particularly to methods and apparatus for blending computer generated graphics objects using layers.
A computer system can output data to a wide variety of output display devices. Output display devices such as laser printers, plotters, image setters and other printing devices produce an image or xe2x80x9cvisual representationxe2x80x9d onto a sheet of paper, a piece of film or the like, while output display devices such as computer monitors develop visual representations on a computer screen.
Many output display devices receive display data in the form of a xe2x80x9cpixelmapxe2x80x9d and generate visual representations from the display data. A pixel is a fundamental picture element of a visual representation generated by a display device, and a pixelmap is a data structure including information concerning a number of pixels of the representation.
A printing device prints dots on a piece of paper corresponding to the information in a pixelmap. Alternatively, a computer monitor illuminates pixels based upon the information in a pixelmap. A xe2x80x9crasterxe2x80x9d output device creates a visual representation by displaying arrays of pixels arranged in rows and columns from the pixelmap. Most output devices, other than plotters, are raster output devices.
Printing and visual output devices that produce output in response to page description language input are widely used. A page description language is a high level language for describing objects to be displayed by an output device. The PostScript(copyright) language developed by Adobe Systems Incorporated of San Jose, Calif., is an example of a page description language. An image to be displayed may be represented and stored in a page description format as a page description language file which includes one or more objects. Generally, a page description language is device independent.
In operation, a conventional printing device configured to process a page description language file interprets the objects within the file and renders the data into pixelmaps to be painted into a frame buffer. Typically, the frame buffer is large enough to store (at least in compressed form) any page that might be printed, and rendered pixelmaps are stored in this buffer. When the entire page has been painted, data stored in the frame buffer may transferred to a print engine or marking engine for printing.
Transparency is a visual blending effect obtained when a background object (image, text, lines or filled regions) is partially obscured by a foreground object that is drawn over the background object. Numerous other blending effects may be used to integrate foreground and background graphics data. Examples of blending effects include a drop shadow effect, a screen effect, darker and lighter effects and overprinting effects.
The manipulation of graphics data at a printer or output display to achieve blending effects typically requires a large amount of memory. Some printing devices include limited memory or shallow frame buffers for performance reasons and thus heretofore were incapable of processing a blending operation at the printer. Recognizing the limitations of some printing devices to manipulate graphics data, PostScript and other similar page description languages generally have not supported blending effects.
In general, in one aspect, the invention features a method of blending graphics data that includes a plurality of objects. The method includes grouping the objects into two layers; drawing the objects associated with a first layer; drawing the objects associated with a second layer; and blending data drawn into the first and second layers.
Preferred embodiments of the invention include one or more of the following features. The drawing step includes rendering object data to generate a pixelmap. The drawing step includes computing a planar map representation of the objects. The method is implemented in a printing device. Objects are drawn opaquely into each layer. One of the first and second layers is drawn into a frame buffer. Data drawn into one of the first and second layers is drawn into a layer buffer, the layer buffer being partitioned into a plurality of tiles, each tile for receiving data associated with a particular portion of a page to be printed; the method includes compressing tiles of the layer buffer into which data is not currently being drawn. The layer buffer is partitioned into a plurality of bands. The step of blending includes blending drawn data from the first and second layer according to a predefined blending operation. The predefined blending operation is selected from the group of transparency, shadow, overprinting, darkening, lightening, screen effect and additive effect.
In general, in another aspect, the invention features a method of blending graphics data in an output display device. The method includes providing groupings of object data associated with an image to be displayed, each grouping defining a layer of the image; creating a layer stack associated with image, the layer stack defining a hierarchy for blending layers of the image; rendering object data associated with each layer; and blending rendered object data for the layers.
Preferred embodiments of the invention include one or more of the following features. The blending step is performed two layers at time, including selecting layers for blending by popping layers off the layer stack.
In general, in another aspect, the invention features a method of blending graphics data in an output display device. The method includes providing groupings of object data associated with an image to be displayed, each grouping defining a layer of the image; providing layer blending information defining a hierarchy for blending layers of the image; rendering object data associated with each layer; and blending rendered object data for the layers.
Preferred embodiments of the invention include one or more of the following features. The blending step is performed two layers at time including selecting layers for blending based on the layer blending information.
In general, in another aspect, the invention features a method of blending graphics data received by a printing device. The method includes receiving object data associated with a first layer of an image to be displayed; transforming the object data to an intermediate form representative of an underlying graphics object; storing the intermediate form data in a first buffer; receiving object data associated with a second layer of the image; transforming the object data to an intermediate form representative of an underlying graphics object; blending intermediate form data for the first and second layer to derive blended data; and printing the image.
In general, in another aspect, the invention features a method of blending graphics data received by a printing device to provide a blending effect for a foreground image with respect to a background image. The method includes receiving one or more foreground objects to be drawn into a foreground layer; drawing the foreground objects to generate foreground data; receiving one or more of background objects to be drawn into a background layer; drawing the background objects to generate background data; blending the foreground and background data to generate a composite image for printing.
In general, in another aspect, the invention features a method of blending graphics data received by a printing device. The method includes providing one or more objects associated with a first layer of an image to be printed; rendering the objects associated with the first layer; storing rendered object data associated with the first layer in a first buffer; providing one or more objects associated with a second layer of the image; rendering the objects associated with the second layer; storing rendered object data associated with the second layer in a second buffer; blending the rendered object data for the first and second layers; and printing the blended rendered object data.
In general, in another aspect, the invention features an apparatus for blending graphics data in a output display device. The apparatus includes an interpreter for receiving object data associated with two layers of an image to be displayed by the output display device and for receiving a layer operator for designating which objects belong to which layer; a drawing engine for drawing objects into a first and a second buffer, the first buffer for receiving data associated with a first layer and the second buffer for receiving data associated with a second layer; and a blend processor for blending data in the first and second buffers prior to display.
Preferred embodiments of the invention include one or more of the following features. One of the first and second buffers is a layer buffer, the layer buffer being partitioned into a plurality of bands, each band for receiving data associated with a particular portion of a page to be displayed; and the apparatus includes a compression engine for compressing bands of the layer buffer into which data is not currently being drawn. The drawing engine includes a render engine for generating pixel data from higher level object data, for receiving object data from the interpreter and for painting pixel data representative of the object data into one of the first and second buffers for all objects in a same layer. The apparatus includes a layer table for storing layer information including blending instructions to direct the output display device to perform a desired blend. The interpreter receives a layer operator indicating a transition between layers and, responsive to the layer operator, data is drawn into a new layer buffer.
In general, in another aspect, the invention features an apparatus for blending graphics data in a output display device. The apparatus includes a frame buffer for storing rendered object data associated with a plurality of objects to be placed in a background layer of an image; a layer buffer for storing rendered object data associated a plurality of objects to be placed in a foreground layer of an image; and a blend processor for blending the foreground and background layers.
Preferred embodiments of the invention include one or more of the following features. The layer buffer is dynamically allocatable and de-allocatable based in part upon receipt of a blending instruction with graphics objects associated with the image.
In general, in another aspect, the invention features a printer configured to receive a page description language description of a page to be printed. The printer includes a frame buffer for storing render data; a layer buffer for temporarily storing rendered data for a layer of an image to printed; a blending engine for blending rendered data stored in the frame buffer and layer buffer; and a print engine for printing blended data resulting in a blending of graphics data according to a user defined blending function.
Among the advantages of the invention are one or more of the following. Blending effects may be implemented in printers that would otherwise not have sufficient memory to support conventional blending methods.
The use of the inventive methods is transparent for non-blended graphics data and thus a performance penalty only occurs when processing blended graphics objects.
A layering process is provided in a display device to allow for division of an image or portion of an image into one or more layers. Blending of objects associated with one or more layers of an image may thereafter be advantageously achieved.
A layering process may be advantageously implemented in systems that manipulate graphics data in display list format or in other formats.
Only a current layer that is being drawn into is required to be maintained in uncompressed form. All other layers may be compressed to save memory space.
In a banding or tiling system, only a portion of the current layer is required to be in an uncompressed form. Bands not being drawn into may be stored in a compressed form.
Layers may be blended in any order and combination to achieve a desired visual effect in the output image. Layers may be nested in multiple layers and resolved according to user preferences in the formulation of an output image which is delivered to a print or display engine.
A simple stack hierarchy may be used to define relationships between layers and the ordering for blending of the layers in the formulation of blended graphics objects.
Layer buffers may be allocated and deallocated dynamically as required to create a desired visual effect. Any number of combinations of differing sized layer buffers may be active at any given time.
Blending effects may be implemented that otherwise would be impossible in a conventional output display device. The inventive teachings disclosed allow for the elimination of undesirable artifacts and other cumulative effects in blending multiple objects.
Other features and advantages of the invention will become apparent from the following description and from the claims.